using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using Bots;
using Bots.Search;
using Bots.Index;

namespace Sample
{
    public class LinkFinder : Finder
    {
        protected override string Table
        {
            get { return "Link"; }
        }

        protected override Type DomainObjectType { get { return typeof(Link); } }

        protected override DomainObject LoadFromReader(System.Data.SqlClient.SqlDataReader reader)
        {
            return CreateLink(reader);
        }

   
        private Link CreateLink(SqlDataReader reader){
            Link link = new Link(reader.GetInt64(0));
            link.Title = reader.GetString(1);
            link.Url = reader.GetString(2);
            link.Description = reader.GetString(3);
            link.CreateDateTime = reader.GetDateTime(4);
            return link;
        }

    }
}
